

<div id="table">
  <h1>Intranet</h1>
  <div class="intro-cartasur">
    <h3>User Protocols: <%= @cuser.login %></h3>
    This page shows the protocols for user <%= @cuser.login %>.
  </div>
</div>

<hr />

<tr>
  <td >Filter user protocols: </td>
  <td>
    <%= link_to "Completed", showobjectives_cartasur_user_path(@cuser, :l=>"yes")  %>|
    <%= link_to "Incomplete", showobjectives_cartasur_user_path(@cuser, :l=>"no")  %>|
    <%= link_to "All", showobjectives_cartasur_user_path(@cuser, :l=>"all")  %>

  </td>
</tr>

<hr />
<%  unless @results.nil? %>
<table cellpadding="5" cellspacing="10" id="zebra-rows">
  <th>Time range(Hours) </th>
  <th>Months </th>
  <th>Days </th>
  <th>Location </th>
  <th>Started</th>
  <% count = 0 #for highlighting rows %>
  <% @results.each do |result| %>
      <tr <%= "class=odd" if count.odd? %>>
        <td><%= result[:objective].time_range %></td><td><%= result[:objective].months %></td>
        <td> <%= result[:objective].days %> </td><td> <%= result[:objective].location_name %> </td>
        <td>
          <% if result[:protocol].try(:nt_visited)  %>
              yes (<%= link_to "view", "/cartasur/visiteds/#{result[:visited].id}/summary" %>)
          <% else %>
              no
          <% end %></td>
      </tr>

      <% count = count + 1 %>
  <% end %>
</table>

<% end %>
   <br />
   <%= link_to "View as xml", "/cartasur/api/objectives.xml?key=#{@cuser.salt}" %>

<br/>
